<template>
  <view class="box" :style="{'backgroundColor':bgColor}">
    <view class="search" :style="{'border-radius':radius + 'px'}" @click="toSearch()">
      <uni-icons type="search" size="20"></uni-icons>
      <view class="placeholder">
        搜索
      </view>
    </view>
  </view>
</template>

<script>
  export default {
    name:"my-search",
    props:{
      bgColor:{
        type:String,
        default:'#c00000'
      },
      radius:{
        type:Number,
        default:25
      }
    },
    data() {
      return {
        
      };
    },
    methods:{
      toSearch() {
        this.$emit('click')
      }
    }
  }
</script>

<style lang="scss">
.box {
  height: 50px;
  // background-color: #c00000;
  display: flex;
  justify-content: center;
  align-items: center;
  .search {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 40px;
    width: 95%;
    background-color: #ffff;
    // border-radius: 25px;
    .placeholder {
      padding-left: 10px;
      font-size: 15px;
      font-weight: bold;
    }
  }
}
</style>